package demo1;

public class Student {
    public String name = "bit";
    private int age = 18;
    public Student() {
        System.out.println("调用无参构造方法");
    }
    private Student(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("调用带两个参数的私有构造方法");
    }
    public void method() {
        System.out.println("调用公开的方法");
    }
    private void methodOther() {
        System.out.println("调用私有的方法");
    }

    @Override
    public boolean equals(Object obj) {
        return super.equals(obj);
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
